package com.enfo.zjabank.tool;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class ContextListener implements ServletContextListener{
	
	Logger logger = LoggerFactory.getLogger(ContextListener.class);
	public static String contextPath;
	public static String contextRealPath;

	@Override
	public void contextInitialized(ServletContextEvent sce) {
		contextPath = sce.getServletContext().getContextPath();
		contextRealPath = sce.getServletContext().getRealPath("/");
		logger.info("应用监听器启动了!");
		logger.info("项目名称:"+contextPath);
		logger.info("应用路径:"+contextRealPath);
	}

	@Override
	public void contextDestroyed(ServletContextEvent sce) {
		System.out.println("this is last destroyeed");
	}
}
